package com.wm.eduService.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wm.eduService.entity.EduTeacher;
import com.wm.eduService.mapper.EduTeacherMapper;
import com.wm.eduService.service.EduTeacherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 讲师 服务实现类
 * </p>
 *
 * @author sshdg
 * @since 2020-09-26
 */
@Service
public class EduTeacherServiceImpl extends ServiceImpl<EduTeacherMapper, EduTeacher> implements EduTeacherService {

    /**
     * C端讲师分页查询
     *
     * @param teacherPage 分页对象
     * @return 分页结果集
     */
    @Override
    public Page<EduTeacher> getTeacherFrontList(Page<EduTeacher> teacherPage) {
        LambdaQueryWrapper<EduTeacher> teacherQuery = new LambdaQueryWrapper<>();
        teacherQuery.orderByDesc(EduTeacher::getGmtModified);
        teacherPage = (Page<EduTeacher>) this.page(teacherPage,teacherQuery);

        return teacherPage;
    }
}
